package com.mti.digital.security.code.generation;

import com.baomidou.mybatisplus.generator.config.GlobalConfig;
import com.baomidou.mybatisplus.generator.config.po.TableField;
import com.baomidou.mybatisplus.generator.config.rules.IColumnType;
import com.mti.digital.security.code.generation.rules.DbColumnType;

public interface ITypeConvert {
    default IColumnType processTypeConvert(GlobalConfig globalConfig, TableField tableField) {
        //将数据库中datetime转换成date
        if (tableField.getType().toLowerCase().contains("geometry")) {
            return DbColumnType.GEOMETRY;
        }
        return this.processTypeConvert(globalConfig, tableField.getType());
    }

    IColumnType processTypeConvert(GlobalConfig globalConfig, String fieldType);
}
